<script type="text/javascript">
	function doSearchMatchProTeacher(value) {
		
	}
	
	//表格查询  
	function reloadMatchProTeacher() {
		var params = matchProTeacher_list.datagrid('options').queryParams; //先取得 datagrid 的查询参数  
		printLog(params);
		matchProTeacher_list.datagrid('reload'); //设置好查询参数 reload 一下就可以了  
		matchProTeacher_list.datagrid('unselectAll');
		matchProTeacher_list.datagrid('uncheckAll');
	}


	function addMatchProTeacher() {
		createFromWindow("新增信息", "matchProTeacher.do?editMatchProTeacher", "matchProTeacher.do?saveMatchProTeacher&matchProArticleId=${matchProArticleId!-1}",
				function(data) {
					reloadMatchProTeacher();
				});
// 		createFromWindowOptions({
// 			title:"新增信息",
// 			maximizable:true,
// 			width:600,
// 			height:400,
// 			saveButtonText:'确定',
// 			href:"matchProTeacher.do?editMatchProTeacher",
// 			callback:function(d) {
// 				var formData = d.form("getData");
// 				printLog(formData);
// 				matchProTeacher_list.datagrid("appendRow", formData);
// 			},
// 			enableSaveButton:true
// 		});
	}
	function addEditMatchProTeacher() {
		var row = {"id":1,"techName":"","techSex":"","techDept":"","techJob":"","techEmail":"","techTel":""};
		matchProTeacher_list.datagrid("appendRow", row);
// 		createFromWindow("新增信息", "matchProTeacher.do?editMatchProTeacher", "matchProTeacher.do?saveMatchProTeacher",
// 				function(data) {
// 					reloadMatchProTeacher();
// 				});
	}
	
	function deleteEditMatchProTeacher() {
		debugger;
		var selectRecord = matchProTeacher_list.datagrid("getSelected");
    	var rowIndex = matchProTeacher_list.datagrid('getRowIndex', selectRecord);
    	matchProTeacher_list.datagrid('deleteRow', rowIndex);
	}
	
	function deleteMatchProTeacher() {
		var rows = matchProTeacher_list.datagrid('getChecked');
	    if (rows&&rows.length>0){
	        $.messager.confirm('询问','你确认要删除吗?',function(r){
	            if (r){
	            	var ids = "";
	            	for(var i=0; i<rows.length; i++){
	            		ids += rows[i].id+",";
	            	}
	                $.post('matchProTeacher.do?deleteMatchProTeacherItems',{ids:ids},function(result){
	                    if (result.success){
	                    	reloadMatchProTeacher();    
	                    }
	                    showMsg(result.msg);
	                },'json');
	            }
	        });
	    }else {
	    	showMsg("请选择操作记录.");
	    }
	}

	function editMatchProTeacher() {
		var rows = matchProTeacher_list.datagrid('getChecked');
		printLog(rows);
		if (rows&&rows.length>0) {
			if(rows.length>1) {
				showMsg('请选择一条操作记录.');
				return;
			}
			createFromWindow("编辑信息", "matchProTeacher.do?editMatchProTeacher&matchProTeacherId=" + rows[0].id,
					"matchProTeacher.do?saveMatchProTeacher", function(data) {
						reloadMatchProTeacher();
					},true);
// 			createFromWindowOptions({
// 				title:"编辑信息",
// 				maximizable:true,
// 				width:600,
// 				height:400,
// 				saveButtonText:'确定',
// 				href:"matchProTeacher.do?editMatchProTeacher",
// 				callback:function(d) {
// 					var formData = d.form("getData");
// 					printLog(formData);
// 					matchProTeacher_list.datagrid("appendRow", formData);
// 				},
// 				enableSaveButton:true
// 			});
		} else {
			showMsg('请选择操作记录.');
		}

	}
	
	
	function clearMatchProTeacherSearch() {
		setGridSearchParams('matchProTeacher_list','matchProTeacherSearchForm',true,reloadMatchProTeacher);
	}
	
	//根据条件查询
	function matchProTeacherSearch() {
		setGridSearchParams('matchProTeacher_list','matchProTeacherSearchForm',false,reloadMatchProTeacher);
	}
	
	function onDblClickMatchProTeacherRow(rowIndex, rowData) {
		createFromWindow("编辑信息", "matchProTeacher.do?editMatchProTeacher&matchProTeacherId=" + rowData.id,
					"matchProTeacher.do?saveMatchProTeacher", function(data) {
						reloadMatchProTeacher();
					},true);
	}
</script>


<div class="easyui-layout" data-options="fit:true">
	<div data-options="region:'center',border:false,">
		<@eu.datagrid pagination="false" id="matchProTeacher_list" toolbar="#matchProTeacherlist_search" idField="id"  url="matchProTeacher.do?loadList&matchProArticleId=${matchProArticleId!-1}" rownumbers="true"
			 item="com.xdtech.match.vo.MatchProTeacherItem"/>
		
		<div id="matchProTeacherlist_search">
			<div id="matchProTeacher_toolbar" style="height: auto">
<!-- 				<@eu.linkbutton showName="新增" shiro="match:matchProTeacher:add" iconCls="icon-add" onclick="addMatchProTeacher()"/> -->
<!-- 				<@eu.linkbutton showName="编辑" shiro="match:matchProTeacher:edit" iconCls="icon-edit" onclick="editMatchProTeacher()"/> -->
<!-- 				<@eu.linkbutton showName="删除" shiro="match:matchProTeacher:delete" iconCls="icon-remove" onclick="deleteMatchProTeacher()"/> -->
			</div>
		</div>
	</div>
</div>